package 正则表达式;

import java.util.Scanner;

public class 案例 {
    public static void main(String[] args) {
        fsyzm();

    }
    public static void fsyzm(){
        Scanner sr=new Scanner(System.in);
        while (true) {
            System.out.println("请输入您要发送验证码的手机号");
            String phone=sr.next();
            if (phone.matches("1[1-9]\\d{9}")){
                System.out.println("验证码发送成功");
                return;
            }else{
                System.out.println("您输入的手机号码错误");
        }
    }
}
            }
